﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace BGSpaceShooter
{
    public class DisplayController
    {
        public Camera Camera { get; set; }
        public Display Display { get; set; }

        /// <summary>
        /// Tworzy instancje klasy Display oraz kamere
        /// </summary>
        /// <param name="graphicsDeviceManager"></param>
        /// <param name="camera"></param>
        public DisplayController(GraphicsDeviceManager graphicsDeviceManager, Camera camera)
        {
            Camera = camera;
            Display = new Display(graphicsDeviceManager);
            Display.Initialize();
        }

        /// <summary>
        /// Rozpoczyna rysowanie, prawdopdobnie bedzie pobierala rowniez czas z maingame
        /// </summary>
        public void Draw(List<IDrawer> drawers)
        {
            lock (Camera)
            {
                Display.Draw(Camera, drawers);
            }
        }
    }
}
